Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add command for running glaredb locally #1012

Merged
merged 4 commits into from
May 23, 2023
Merged

feat: Add command for running glaredb locally #1012

merged 4 commits into from
May 23, 2023

Conversation

scsmithr
Copy link
Member

Closes #1008

Help:

Starts a local version of GlareDB

Usage: glaredb local [OPTIONS]

Options:
  -m, --metastore-addr <METASTORE_ADDR>
          Address to the Metastore.

          If not provided, an in-process metastore will be started.

      --spill-path <SPILL_PATH>
          Path to spill temporary files to

  -f, --local-file-path <LOCAL_FILE_PATH>
          Local file path to store database catalog (for a local persistent store)

  -h, --help
          Print help (see a summary with '-h')

Running:

     Running `target/debug/glaredb local`
GlareDB (0.0.8)
> select 1;
+----------+
| Int64(1) |
+----------+
| 1        |
+----------+
> select 1; select 2;
+----------+
| Int64(1) |
+----------+
| 1        |
+----------+
+----------+
| Int64(2) |
+----------+
| 2        |
+----------+
> select what from where;
ERROR: Error during planning: Context provider for SQL planner is missing a table: where
> interrupt: 2

Closes #1008

Help:
```
Starts a local version of GlareDB

Usage: glaredb local [OPTIONS]

Options:
  -m, --metastore-addr <METASTORE_ADDR>
          Address to the Metastore.

          If not provided, an in-process metastore will be started.

      --spill-path <SPILL_PATH>
          Path to spill temporary files to

  -f, --local-file-path <LOCAL_FILE_PATH>
          Local file path to store database catalog (for a local persistent store)

  -h, --help
          Print help (see a summary with '-h')
```

Running:
```
     Running `target/debug/glaredb local`
GlareDB (0.0.8)
> select 1;
+----------+
| Int64(1) |
+----------+
| 1        |
+----------+
> select 1; select 2;
+----------+
| Int64(1) |
+----------+
| 1        |
+----------+
+----------+
| Int64(2) |
+----------+
| 2        |
+----------+
> select what from where;
ERROR: Error during planning: Context provider for SQL planner is missing a table: where
> interrupt: 2
```
@scsmithr scsmithr requested review from vrongmeal and f0ssel May 22, 2023 20:37
Comment on lines 59 to 64
Err(ReadlineError::Interrupted) => {
break;
}
Err(ReadlineError::Eof) => {
break;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Err(ReadlineError::Interrupted) => {
break;
}
Err(ReadlineError::Eof) => {
break;
}
Err(ReadlineError::Interrupted) | Err(ReadlineError::Eof) => {
break;
}

Comment on lines 119 to 120
ExecutionResult::Query { stream, .. } => print_stream(stream).await?,
ExecutionResult::ShowVariable { stream } => print_stream(stream).await?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ExecutionResult::Query { stream, .. } => print_stream(stream).await?,
ExecutionResult::ShowVariable { stream } => print_stream(stream).await?,
ExecutionResult::Query { stream, .. } | ExecutionResult::ShowVariable { stream } => print_stream(stream).await?,

Copy link
Contributor

@vrongmeal vrongmeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good! Excited to have this for testing out stuff quickly!

@scsmithr scsmithr enabled auto-merge (squash) May 23, 2023 12:01
@scsmithr scsmithr merged commit aa3edb8 into main May 23, 2023
@scsmithr scsmithr deleted the sean/local-cmd branch May 23, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a local shell to avoid needing to connect via pgsrv
2 participants